/*
 * @Author: your name
 * @Date: 2021-10-18 15:32:37
 * @LastEditTime: 2022-05-28 11:22:45
 * @LastEditors: 张祥 17839092765@163.com
 * @Description: In User Settings Edit
 * @FilePath: \vue-ts\src\router\index.js
 */
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import { HomeItem } from './modules/home'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    redirect: '/home/EquipmentManagement',
    component: () => import('@/Views/home/index.vue'),
    children: HomeItem
  },

  {
    // 匹配所有路径  vue2使用*   vue3使用/:pathMatch(.*)*或/:pathMatch(.*)或/:catchAll(.*)
    path: '/:pathMatch(.*)',

    component: () => import('@/Views/404/index.vue')
  }
]

const router = createRouter({
  //@ts-ignore
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
